import threading
from modelo.Serie import Serie
from servicios.Functions import *

class ThreadSerieChecker(threading.Thread):
	_id_serie = None
	_series_list = None
	def __init__(self, idSerie, seriesList):
		threading.Thread.__init__(self)
		self._id_serie = idSerie
		self._series_list = seriesList

	def run(self):
            try:
		serie = Serie.get_instance(self._id_serie)
		is_complete = serie.is_complete()
		name = serie.get_name()
		self._series_list.append ( (self._id_serie, iif(is_complete , '' , '>') + name + iif(is_complete , ' [Completa]' , ' [Incompleta]') ) )
            except Exception,e:
                print e